package com.liang.pcc.mapper;

import com.liang.pcc.dto.resp.IntegrationDataResp;
import com.liang.pcc.dto.resp.ReverseLoadRateResp;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface DataMapper {

    List<ReverseLoadRateResp> getReverseLoadRate(@Param("fileId") Long fileId, Long userId);

    /**
     * 获取整合数据
     */
    List<IntegrationDataResp> getIntegrationData(@Param("fileId") Long fileId, Long userId);

    @Delete("delete from bus_param where file_id = #{fileId} and user_id = #{userId}")
    void removeBusParam(Long fileId, Long userId);

    @Delete("delete from device_info where file_id = #{fileId} and user_id = #{userId}")
    void removeDeviceInfo(Long fileId, Long userId);

    @Delete("delete from equipment_line_info where file_id = #{fileId} and user_id = #{userId}")
    void removeEquipmentLineInfo(Long fileId, Long userId);

    @Delete("delete from evaluation_history where file_id = #{fileId} and user_id = #{userId}")
    void removeEvaluationHistory(Long fileId, Long userId);

    @Delete("delete from harmonic_data where file_id = #{fileId} and user_id = #{userId}")
    void removeHarmonicData(Long fileId, Long userId);

    @Delete("delete from measurement_point where file_id = #{fileId} and user_id = #{userId}")
    void removeMeasurementPoint(Long fileId, Long userId);

    @Delete("delete from power_data where file_id = #{fileId} and user_id = #{userId}")
    void removePowerData(Long fileId, Long userId);

    @Delete("delete from short_circuit_current_verification where file_id = #{fileId} and user_id = #{userId}")
    void removeShortCircuitCurrentVerification(Long fileId, Long userId);

    @Delete("delete from topology_data where file_id = #{fileId} and user_id = #{userId}")
    void removeTopologyData(Long fileId, Long userId);

    @Delete("delete from voltage_deviation_check where file_id = #{fileId} and user_id = #{userId}")
    void removeVoltageDeviationCheck(Long fileId, Long userId);
}
